package ej1.Main;

import java.util.ArrayList;

public class ProblemInstance {

	private int _strainCount;
	private int _mutationCount;
	private Strain[] _strains;

	public ProblemInstance(){
		
		_strainCount = 0;
		_mutationCount = 0;
		_strains = new Strain[0];
		
	}
	
	
	public int getStrainCount() {
		return _strainCount;
	}

	public void setStrainCount(int strainCount) {
		this._strainCount = strainCount;
		_strains = new Strain[strainCount];
	}

	public int getMutationCount() {
		return _mutationCount;
	}

	public void setMutationCount(int mutationCount) {
		this._mutationCount = mutationCount;
	}

	public void AddMutation(int aStrainId, int anotherStrainId) {

		_strains[aStrainId - 1].nowCanMutateTo(_strains[anotherStrainId - 1]);
		
	}
	
	public void addStrain(int aStrainId) {
		
		_strains[aStrainId - 1] = new Strain(aStrainId);
		
	}

	public Iterable<Strain> getStrains() {
		
		ArrayList<Strain> strains = new ArrayList<Strain>();
		
		for (int i = 0; i < _strainCount; i++ )
			strains.add(_strains[i]);
		
		return strains;
	}

}
